package com.newlink.building.main.mvp.model

import com.newlink.building.common_base.base.BaseModel
import com.newlink.building.common_base.http.Base_RetrofitHelper
import com.newlink.building.common_base.model.bean.*
import com.newlink.building.main.mvp.contract.Module_Main_MainContract
import io.reactivex.Observable

/**
 * Created by xiaodong on 2022/7/25.
 */
class Module_Main_MainModel : BaseModel(), Module_Main_MainContract.Model {
    override fun logout(token: String): Observable<HttpResult<Boolean>> {
        return Base_RetrofitHelper.service.logout(token)
    }

    override fun getUserInfo(token: String, userId: Long): Observable<HttpResult<UserInfoData>> {
        return Base_RetrofitHelper.service.getUserInfo(token, userId)
    }

    override fun checkTokenAvailable(token: String): Observable<Base_BaseBean> {
        return Base_RetrofitHelper.service.checkTokenAvailable(token)
    }

//    override fun connectKcp(data: KcpInfoData): Observable<KcpResult<Int>> {
//        return KcpTaskHelper.instance.execConnectTask(data)
//    }
//
//    override fun reConnectKcp() {
//        KcpTaskHelper.instance.startRntcConnectLoop(KcpTaskHelper.KCP_CONNECT_FAILED)
//    }

//    override fun logout(): Observable<HttpResult<Any>> {
// //        return RetrofitHelper.service.logout()
//    }
//
//    override fun getUserInfo(): Observable<HttpResult<UserInfoBody>> {
//        return RetrofitHelper.service.getUserInfo()
//    }
}
